package com.sihai.ehr.model.biz;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

import com.sihai.core.BaseEntity;
import com.sihai.ehr.model.sys.ExaminePeriodEnum;
import com.sihai.ehr.model.sys.Organization;
import com.sihai.ehr.model.sys.SalaryFrameworkEnum;
import com.sihai.ehr.model.sys.SalaryLinkedEnum;
import com.sihai.ehr.model.sys.SalaryStructureEnum;

/**
 * 薪资框架细节
 * 
 * @author henry
 * 
 */
@Entity
public class SalaryStructureDetail extends BaseEntity<Long> {

	/**
	 * 
	 */
	private static final long serialVersionUID = 2681689760620599293L;

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	private Long id;

	/** 组织结构ID */
	@ManyToOne(cascade = { CascadeType.MERGE, CascadeType.REFRESH }, optional = true)
	@JoinColumn(name = "struct_id")
	private SalaryStructure salaryStructure;
	/** 框架类型 */
	@Enumerated(EnumType.STRING)
	private SalaryStructureEnum structType;
	/** 规则名称 */
	private String schemeTitle;
	/** 挂钩数据类型 */
	@Enumerated(value = EnumType.STRING)
	private SalaryFrameworkEnum linkedDataType;
	/** 连接规则编号 */
	private Long linkedDataId;
	/** 连接数据标题 */
	private String linkedDataTitle;

	private String unit;
	private Float unitCost;
	private Float fixedCost;
	/** 周期类型 */
	@Enumerated(EnumType.STRING)
	private ExaminePeriodEnum periodType;
	/** 周期计算方式 0:表示自然月，其它表示按指定日 */
	private int periodComputeMode;

	@Override
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public SalaryStructure getSalaryStructure() {
		return salaryStructure;
	}

	public void setSalaryStructure(SalaryStructure salaryStructure) {
		this.salaryStructure = salaryStructure;
	}

	public SalaryStructureEnum getStructType() {
		return structType;
	}

	public void setStructType(SalaryStructureEnum structType) {
		this.structType = structType;
	}

	public String getSchemeTitle() {
		return schemeTitle;
	}

	public void setSchemeTitle(String schemeTitle) {
		this.schemeTitle = schemeTitle;
	}

	public SalaryFrameworkEnum getLinkedDataType() {
		return linkedDataType;
	}

	public void setLinkedDataType(SalaryFrameworkEnum linkedDataType) {
		this.linkedDataType = linkedDataType;
	}

	public Long getLinkedDataId() {
		return linkedDataId;
	}

	public void setLinkedDataId(Long linkedDataId) {
		this.linkedDataId = linkedDataId;
	}
	
	public String getLinkedDataTitle() {
		return linkedDataTitle;
	}
	
	public void setLinkedDataTitle(String linkedDataTitle) {
		this.linkedDataTitle = linkedDataTitle;
	}

	public String getUnit() {
		return unit;
	}

	public void setUnit(String unit) {
		this.unit = unit;
	}

	public Float getUnitCost() {
		return unitCost;
	}

	public void setUnitCost(Float unitCost) {
		this.unitCost = unitCost;
	}

	public Float getFixedCost() {
		return fixedCost;
	}

	public void setFixedCost(Float fixedCost) {
		this.fixedCost = fixedCost;
	}

	public ExaminePeriodEnum getPeriodType() {
		return periodType;
	}

	public void setPeriodType(ExaminePeriodEnum periodType) {
		this.periodType = periodType;
	}

	public int getPeriodComputeMode() {
		return periodComputeMode;
	}

	public void setPeriodComputeMode(int periodComputeMode) {
		this.periodComputeMode = periodComputeMode;
	}
}
